#ifndef COLLISION_MESH_H
#define COLLISION_MESH_H

#include <vector>
#include "Vec3.h"
#include "Capsule.h"
#include "Tri.h"
#include "OBJMesh.h"

class CollisionMesh
{
public:
    void AddTri(const Tri& t);
    void Draw(); // for debugging
	void MakeMeshFromOBJ(OBJMesh* TheOBJ);

    typedef std::vector<const Tri*> TriPtrs;

    // Returns true if the given capsule intersects this mesh.
    // If there is an intersection, the vector is populated:
    // each element is a pointer to a Triangle which intersects 
    // the capsule.
    bool Intersects(const Capsule& c, TriPtrs* pVec);
	bool MultiIntersects(const Capsule& c, TriPtrs* pVec);
	bool SpherePlaneIntersects(const Capsule& c, Vec3f* PointOfContact);

private:
    Tris m_tris;
	OBJMesh Obj;
};

#endif
